package org.lds.message.center.admin.business.template.converter;

import org.lds.message.center.admin.business.template.entity.Template;
import org.lds.message.center.admin.business.template.model.request.TemplateBaseListRequest;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;


@Component
public class TemplateBaseListRequestToEntityConverter implements Converter<TemplateBaseListRequest, Template> {

    @Override
    public Template convert(TemplateBaseListRequest source) {
        return Template.builder()
                .id(source.getId())
                .appId(source.getAppId())
                .name(source.getName())
                .desc(source.getDesc())
                .enable(source.getEnable())
                .subject(source.getSubject())
                .text(source.getText())
                .createTime(source.getCreateTime())
                .updateTime(source.getUpdateTime())
                .build();
    }

}


